Skip to content

governance: principle-as-plugin — array emptied, governance is pure aggregator#8

Merged
dancinlife merged 2 commits into
mainfrom
feat/governance-principle-plugins
May 17, 2026
Merged

governance: principle-as-plugin — array emptied, governance is pure aggregator#8
dancinlife merged 2 commits into
mainfrom
feat/governance-principle-plugins

Conversation

@dancinlife
Copy link
Copy Markdown
Contributor

Summary

GOVERNANCE_PRINCIPLES was a 16-entry hardcoded array in
plugins/governance/main.hexa. This moves every principle into a
plugin and reduces governance to a pure aggregator + profile resolver.
2 commits (vertical slice + full fan-out):

  • slice — aggregation infra: governance_collect_principles fires a
    governance_principles transform fold (via the phase-1.5
    host_fire_hook); contributing plugins append #{id,order,default_on, text}; governance merges, order-sorts, profile-filters. readme-format
    migrated as the reference pattern.
  • fan-out — the remaining 15: guard-merge ×5 (a guard that ENFORCES a
    principle also CONTRIBUTES its text = single SSOT: guard-readme-format,
    guard-hexa-verify, guard-domain-lint, guard-tape-append-only,
    project-rules) + 11 new principle-<id> plugins for the non-enforced
    text principles. GOVERNANCE_PRINCIPLES = [].

Registration (default-bundle)

core/dispatch_table.hexa (use + dispatch arm + dispatch_static_ids +
bundled_manifests ×11), plugins/_bundle (×11 members), core/loader.hexa
(×11 family/category). New plugins are default-bundle (the agent's
operating constitution); profile / WILSON_GOVERNANCE_OFF still gate the
active subset.

Test

wilson build (default) OK; wilson test 23/23; plugin info principle-ai-native registered; contribution unit-checked for the 4
hand-merged guards (varied structure) + generated plugins; governance
selftest honestly rewritten for the aggregator architecture (fake-host
void-bus degrades to empty by design — profile-resolution steps 1-5 are
fold-independent and covered; default_on/active-subset/block need the
real fold → covered by wilson test + contribution checks + the slice's
end-to-end proof). Correctness by construction (same fire_hook /
event_bus _is_replace path proven elsewhere this session).

Notes

  • g8: core changes are the generic plugin index (dispatch_table /
    _bundle / loader taxonomy) every plugin needs — not policy coupling.
  • governance/AGENTS.tape g1 (a deny:write rule that mandated editing
    the now-gone array) + SPEC.md banner corrected. Per-principle SPEC
    §Principles rewrite flagged as doc-debt (non-blocking).

🤖 Generated with Claude Code

dancinlife and others added 2 commits May 17, 2026 23:10
GOVERNANCE_PRINCIPLES was a 16-entry hardcoded array. Move each entry to
a plugin (granularity option 2: a guard that already ENFORCES a principle
becomes the single SSOT by also CONTRIBUTING its text; non-enforced
principles → new principle-<id> plugins later). governance becomes a
pure aggregator + profile resolver.

Mechanism: governance_collect_principles fires host_fire_hook(
"governance_principles", {list:[]}) (the generic wrapper added in phase
1.5) — contributing plugins append #{id,order,default_on,text} via the
event_bus transform fold; governance merges with the not-yet-migrated
in-code array (id-dedup, plugin wins), sorts by order (legacy entry →
1-based index implicit order), then applies the existing profile /
WILSON_GOVERNANCE_OFF / default_on resolution (unchanged, still
governance-owned). Fake-host (void bus) guard skips the hook so
selftests stay on the array path.

This slice (vertical, 1 principle):
- governance/main.hexa: collect / order_sort / has_id / is_on_rec;
  active_principles, active_principle_ids, principles(), default_on
  rewritten over the collected set; readme-format removed from the array.
- guard-readme-format/main.hexa: subscribes governance_principles@transform,
  grf_on fold branch, grf_principle_text() (text moved verbatim). This
  guard is now the single SSOT for readme-format (enforce + text).

Verified: wilson build (default) OK; wilson test 23/23; governance
selftest ok (array path + profile resolution unchanged); unit-checked
the new contribution path (grf_on on governance_principles/transform
returns {action:replace,value:{list:[readme-format rec]}} with
id/order=16/default_on/text intact). End-to-end session render is
outside `wilson test` (interactive+LLM); correctness by construction
(same fire_hook/_is_replace contract proven elsewhere this session).

Reference pattern for the remaining 15 (4 guard-merges + ~11 new
principle-<id> plugins) — fan-out tracked in the session log.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…overnance is pure aggregator

Completes the migration started by the readme-format slice. All 16
GOVERNANCE_PRINCIPLES entries are now plugin-owned; the in-code array is
empty; governance only aggregates (governance_collect_principles fires
the governance_principles transform fold) + resolves profiles.

- guard-merge (5): the guard that ENFORCES a principle also CONTRIBUTES
  its text (single SSOT) — readme-format→guard-readme-format (slice),
  hexa-verifier-cli→guard-hexa-verify, domain-meta-domain→guard-domain-lint,
  tape-runtime-trace→guard-tape-append-only, project-governance→project-rules.
- new principle-<id> plugins (11): the non-enforced text principles
  (verification-via-hexa-cli-only, atlas-knowledge, atlas-strict-lint,
  hexa-cli-surface, ai-native, pool-resource-routing, hexa-first,
  andrej-karpathy-skills, lattice-as-tool, step-by-step-decision-gate[off],
  closure-depth-accumulation[off]). Generated (verbatim text, no
  transcription drift); uniform governance_principles@transform contributor.
- registration: core/dispatch_table.hexa (use + dispatch arm +
  dispatch_static_ids + bundled_manifests, all 11), plugins/_bundle
  (11 members), core/loader.hexa (11 family/category). default-bundle.
- governance/main.hexa: GOVERNANCE_PRINCIPLES = []; collect/order_sort/
  is_on_rec drive everything via the fold (profile resolution unchanged).
- docs: governance main.hexa header + AGENTS.tape g1 (a deny:write rule
  that wrongly mandated editing the now-gone array) / ssot / l1 /
  x_principle_plugins / id001 + SPEC.md banner corrected to "each
  principle's SSOT = its plugin; governance aggregates". Per-principle
  SPEC §Principles rewrite flagged as doc-debt.

Verified: wilson build (default) OK; wilson test 23/23; plugin info
principle-ai-native registered; contribution unit-checked for the 4
hand-merged guards (varied structure) + generated plugins (correct
{id,order,default_on,text}); governance selftest honestly rewritten for
the aggregator architecture (fake-host void-bus degrades to empty by
design; profile-resolution steps 1-5 are fold-independent and covered)
→ ok. End-to-end fold proven by the readme-format slice + by
construction (same fire_hook/_is_replace path).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dancinlife dancinlife merged commit 77e8549 into main May 17, 2026
0 of 2 checks passed
@dancinlife dancinlife deleted the feat/governance-principle-plugins branch May 17, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant